<?php

/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 */
class ApplicationConfig {

    private static $instance;

    private function __construct() {
        
    }

    public static function app() {
        if (!isset(self::$instance)) {
            $c = __CLASS__;
            self::$instance = new $c;
            //self::$instance->themeJsUrl = 'jsURLLLLL' ;
            self::$instance->setParams();
        }

        return self::$instance;
    }

    public function setParams() {
        $array['base'] = array(
            'jsUrl' => Yii::app()->baseUrl . '/js/',
            'cssUrl' => Yii::app()->baseUrl . '/css/',
            'imageUrl' => Yii::app()->baseUrl . '/images/',
        );

        $array['theme'] = array(
            'jsUrl' => Yii::app()->theme->baseUrl . '/js/',
            'cssUrl' => Yii::app()->theme->baseUrl . '/css/',
            'imageUrl' => Yii::app()->theme->baseUrl . '/images/',
            'fontUrl' => Yii::app()->theme->baseUrl . '/fonts/',
        );

        $array['folder_path'] = array(
            'bannerImages' => YiiBase::getPathOfAlias('webroot.uploads.banner_images') . '/',
            'vendorImages' => YiiBase::getPathOfAlias('webroot.uploads.vendor_images.original') . '/',
            'vendorBackgroundImage' => YiiBase::getPathOfAlias('webroot.uploads.vendor_images.background') . '/',
            'vendorImagesThumb' => YiiBase::getPathOfAlias('webroot.uploads.vendor_images.thumbnail') . '/',
            'offerThumbnail' => YiiBase::getPathOfAlias('webroot.uploads.offer_images.thumbnails') . '/',
            'offerOriginal' => YiiBase::getPathOfAlias('webroot.uploads.offer_images.original_images') . '/',
            'productcatalogueOriginal' => YiiBase::getPathOfAlias('webroot.uploads.productcatalogue_image.original_images') . '/',
            'productcatalogueThumbnail' => YiiBase::getPathOfAlias('webroot.uploads.productcatalogue_image.thumbnails') . '/',
            'BrandOriginalVideo' => YiiBase::getPathOfAlias('webroot.uploads.upload_videos.brand_videos.original') . '/',
            'BrandVideoThumb' => YiiBase::getPathOfAlias('webroot.uploads.upload_videos.brand_videos.thumbnails') . '/',
            'BrandConvertedVideo' => YiiBase::getPathOfAlias('webroot.uploads.upload_videos.brand_videos.converted') . '/',
            'profileImages' => YiiBase::getPathOfAlias('webroot.uploads.profile_images') . '/',
         	'profileImagesThumbnail' => YiiBase::getPathOfAlias('webroot.uploads.profile_images.thumbnails') . '/',
            'collegeIdImages' => YiiBase::getPathOfAlias('webroot.uploads.college_id_images') . '/',
            'competitionImages' => YiiBase::getPathOfAlias('webroot.uploads.competition_images') . '/',
            'competitionUserImages' => YiiBase::getPathOfAlias('webroot.uploads.competition_user_images') . '/',
            'surveyImages' => YiiBase::getPathOfAlias('webroot.uploads.survey_images') . '/',
            'categoryImages' => YiiBase::getPathOfAlias('webroot.uploads.category_images.thumbnails') . '/',
            'resume' => YiiBase::getPathOfAlias('webroot.uploads.resume') . '/',
            'jobtypeImgthumb' => YiiBase::getPathOfAlias('webroot.uploads.job_type_images.thumbnails') . '/',
            'jobtypeImage' => YiiBase::getPathOfAlias('webroot.uploads.job_type_images.original') . '/',
            'categoryImgthumb' => YiiBase::getPathOfAlias('webroot.uploads.category_images.thumbnails') . '/',
            'categoryImage' => YiiBase::getPathOfAlias('webroot.uploads.category_images.original') . '/',
            'staticPageIcon'=>YiiBase::getPathOfAlias('webroot.uploads.staticpage_icons').'/',
        	'Temp' => YiiBase::getPathOfAlias('webroot.uploads.temp') . '/',
        	'JSONFiles' => YiiBase::getPathOfAlias('webroot.uploads.json_files') . '/',
            'File_Downloads'=>YiiBase::getPathOfAlias('webroot.uploads.documents') . '/'
			
        );

        $array['url_path'] = array(
            'bannerImages' => Yii::app()->baseUrl . '/uploads/banner_images/',
            'vendorImages' => Yii::app()->baseUrl . '/uploads/vendor_images/original/',
            'vendorBackgroundImage' => Yii::app()->baseUrl . '/uploads/vendor_images/background/',
            'vendorImagesThumb' => Yii::app()->baseUrl . '/uploads/vendor_images/thumbnail/',
            'offerThumbnail' => Yii::app()->baseUrl . '/uploads/offer_images/thumbnails/',
            'offerOriginal' => Yii::app()->baseUrl . '/uploads/offer_images/original_images/',
            'productcatalogueOriginal' => Yii::app()->baseUrl . '/uploads/productcatalogue_image/original_images/',
            'productcatalogueThumbnail' => Yii::app()->baseUrl . '/uploads/productcatalogue_image/thumbnails/',
            'BrandOriginalVideo' => Yii::app()->baseUrl . '/uploads/upload_videos/brand_videos/original/',
            'BrandVideoThumb' => Yii::app()->baseUrl . '/uploads/upload_videos/brand_videos/thumbnails/',
            'BrandConvertedVideo' => Yii::app()->baseUrl . '/uploads/upload_videos/brand_videos/converted/',
            'advertiseVideo' => Yii::app()->baseUrl . '/uploads/upload_videos/ad_videos/original',
            'advertiseVideoImage' => Yii::app()->baseUrl . '/uploads/upload_videos/ad_videos/thumbnails/',
            'profileImages' => Yii::app()->baseUrl . '/uploads/profile_images/',
        	'profileImagesThumbnail' => Yii::app()->baseUrl . '/uploads/profile_images/thumbnails/',
            'collegeIdImages' => Yii::app()->baseUrl . '/uploads/college_id_images/',
            'competitionImages' => Yii::app()->baseUrl . '/uploads/competition_images/',
            'competitionUserImages' => Yii::app()->baseUrl . '/uploads/competition_user_images/',
            'surveyImages' => Yii::app()->baseUrl . '/uploads/survey_images/',
            'categoryImages' => Yii::app()->baseUrl . '/uploads/category_images/original/',
            'resume' => Yii::app()->baseUrl . '/uploads/resume',
            'jobtypeImgthumb' => Yii::app()->baseUrl . '/uploads/job_type_images/thumbnails/',
            'jobtypeImage' => Yii::app()->baseUrl . 'uploads/job_type_images/original/',
            'categoryImgthumb' => Yii::app()->baseUrl . '/uploads/category_images/thumbnails/',
            'categoryImage' => Yii::app()->baseUrl . '/uploads/category_images/original/',
            'staticPageIcon'=>Yii::app()->baseUrl . '/uploads/staticpage_icons/',
			'facebook_offer_image'=>'/uploads/vendor_images/thumbnail/',
			'facebook_surveyImages'=>'/uploads/survey_images/',
			'facebook_comptImages'=>'/uploads/competition_images/',
            'File_Downloads'=>Yii::app()->baseUrl . '/uploads/documents/'
			
        );


        $array['module'] = array(
            'admin' => 'admin',
            'user_register' => 'user_register',
        );
        $array['scaling_params'] = array(
            'resize_to_thumbnail' => array('width' => 154, 'height' => 103),
            'resize_to_medium_photo' => array('width' => 431, 'height' => 402),
            'scale_large_image' => array('scale' => 80),
            'board' => array('SSC' => 'SSC','CBSE' => 'CBSE', 'ICSE' => 'ICSE'), //created by Mandar Kulkarni on 30-06-12 
            'highGradUniversity' => array('1'=>'Agra University','2'=>'AIMA','3'=>'Aligarh Muslim University','4'=>'Allahabad University','5'=>'Amaravati University','6'=>'Amity Business School','7'=>'Andhra University','8'=>'Anna University','9'=>'Annamalai University','10'=>'Apeejay School of Marketing','11'=>'APTECH','12'=>'Banaras Hindu University','13'=>'Bangalore University','14'=>'Barkatullah University','15'=>'Berhampur University','16'=>'Bharathiar University','17'=>'Bharathidasan University','18'=>'BITS (Mesra)','19'=>'BITS (Pilani)','20'=>'Board of Technical Education','21'=>'Calcutta University','22'=>'Calicut University','23'=>'CDAC','24'=>'Chennai University','25'=>'DAVV, Indore','26'=>'Delhi College of Engineering','27'=>'Delhi University','28'=>'Devi Ahilya University','29'=>'DOEACC','30'=>'FMS,Delhi','31'=>'Fore School of Management','32'=>'Goa Institute of Management','33'=>'Goa University','34'=>'Gujarat University','35'=>'Gulbarga University','36'=>'Hyderabad University','37'=>'ICFAI','38'=>'ICSI','39'=>'ICWA','40'=>'IGNOU','41'=>'IIM, Ahmedabad','42'=>'IIM, Bangalore','43'=>'IIM, Calcutta','44'=>'IIM, Indore','45'=>'IIM, Kozhikode','46'=>'IIM, Lucknow','47'=>'IIPM','48'=>'IISWBM, Calcutta','49'=>'IIT,Chennai','50'=>'IIT,Delhi','51'=>'IIT,Guwahati','52'=>'IIT,Kanpur','53'=>'IIT,Kharagpur','54'=>'IIT,Mumbai','55'=>'IIT,Roorkee','56'=>'IMI, Delhi','57'=>'IMT,Ghaziabad','58'=>'Indian Institute of Foreign Trade','59'=>'Indian Institute of Science','60'=>'Indian Statistical Institute','61'=>'Institute of Chartered Accountants of India','62'=>'IRM, Anand','63'=>'IT,BHU','64'=>'Jadavpur University','65'=>'Jamia Millia Islamia','66'=>'Jawaharlal Nehru University','67'=>'Jiwaji University','68'=>'JNTU,Hyderabad','69'=>'kakatiya university','70'=>'kanpur university','71'=>'Karanataka University','72'=>'Kerala University','73'=>'Kurukshetra University','74'=>'Kuvempu University','75'=>'Lucknow University','76'=>'Madurai Kamaraj University','77'=>'Mahatma Gandhi University','78'=>'Mangalore University','79'=>'MDI,Gurgaon','80'=>'Meerut University','81'=>'Mumbai University','82'=>'Nagarjuna University','83'=>'Nagpur University','84'=>'NIFT','85'=>'NIIT','86'=>'NMIMS,Mumbai','87'=>'North Maharashtra University','88'=>'OSMANIA UNIVERSITY','89'=>'Panjab University','90'=>'Pondicherry University','91'=>'Pune University','92'=>'Punjab Technical University','93'=>'Rajasthan University','94'=>'Ranchi University','95'=>'RECs','96'=>'Sambalpur University','97'=>'Saurashtra University','98'=>'Shivaji University','99'=>'South Gujarat University,Surat','100'=>'SP Jain Institute of Management Studies','101'=>'Sri Venkateshwara University','102'=>'Symbiosis,Pune','103'=>'TA Pai Management Institute','104'=>'Tata Institute of Social Sciences','105'=>'University of Mysore','106'=>'Utkal University','107'=>'Visveshwaraiah University','108'=>'XIM, Bhubaneswar','109'=>'XISS, Ranchi','110'=>'XLRI, Jamshedpur','111'=>'YMCA','112'=>'Other'),
            'yearOfPassing' => array('startYear' => 1992, 'endYear' => date("Y")), //created by Mandar Kulkarni on 30-06-12
            'yearOfExp' => array('startExp' => 0, 'endExp' => 25), //created by Mandar Kulkarni on 30-06-12
            'monthOfPassing' => array('startMonth' => 0, 'endMonth' => 12), //created by Mandar Kulkarni on 30-06-12
            'collegeBoard' => array('HSC' => 'HSC', 'CBSE' => 'CBSE', 'ICSE' => 'ICSE'), //created by Mandar Kulkarni on 03-07-12
            'phyChallenge' => array('0' => 'Yes', '1' => 'No'), //created by Mandar Kulkarni on 03-07-12
            'qualType' => array('G' => 'Graduate', 'PG' => 'PostGraduate', 'D' => 'Doctorate'), //created by Mandar Kulkarni on 04-07-12
            'highGradType' => array('1' => 'FullTime', '2' => 'PartTime', '3' => 'Correspondance'), //created by Mandar Kulkarni on 04-07-12
            'makelive' => array('0' => 'DISABLED', '1' => 'ENABLED'),
            'Featured' => array('0' => 'NO', '1' => 'YES'),
            'actPointValues' => array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20'),
            'actPointDurationValues' => array('0' => 'NA', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', '11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15', '16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20'),
            'durationUnit' => array('1' => 'minute', '2' => 'hour', '3' => 'day', '4' => 'week', '5' => 'month', '6' => 'year'),
            'CTCRange'=>array('1'=>'Less Than 1Lac','2'=>'1Lac - 2Lac','3'=>'2Lac-5lac','4'=>'5Lac - 10Lac'),
            'top-cities' => array(849, 1351, 817, 1475, 37, 446, 325, 1506, 549, 333, 0),
            'qualification'=>array('1'=>'Accountant','2'=>'B.Com','3'=>'CA>>Business','4'=>'CA>>Job','5'=>'CA>>Practice','6'=>'CFA','7'=>'CS','8'=>'CWA','9'=>'Finance Professional','10'=>'M.Com','11'=>'MBA','12'=>'Student>>CA>>CPT','13'=>'Student>>CA>>Final','14'=>'Student>>CA>>PCC/PE-IT','15'=>'Student>>CFA','16'=>'Student>>CS','17'=>'Student>>CWA','18'=>'Student>>MBA','19'=>'Student>>Others','20'=>'Others')
            );
        $array['job_params'] = array(
            //'type'=>array('1'=>'Full Time', '2'=>'Part Time', '3'=>'Internship', '4'=>'Work from home','5'=>'Volunteering','6'=>'Contract','7'=>'Casual'),
            'industry' => array('1' => 'Agriculture', '2' => 'contruction', '3' => 'manufacturing', '4' => 'transportation and warehousing', '5' => 'professional/technical services', '6' => 'arts/entertainment/recreation', '7' => 'Application Programming'),
            'empType' => array('1' => 'Full Time', '2' => 'Part Time', '3' => 'Internship'),
            'empStatus' => array('1' => 'Current', '2' => 'Previous'),
            'monthName' => array('1' => 'January', '2' => 'February', '3' => 'March', '4' => 'April', '5' => 'May', '6' => 'June', '7' => 'July', '8' => 'August', '9' => 'September', '10' => 'October', '11' => 'November', '12' => 'December'),
            'casual_type' => array('1' => 'Weekdays', '2' => 'Weekends', '3' => 'Daytime', '4' => 'Nighttime'),
            'salary_specification' => array('1' => 'Day', '2' => 'Week', '3' => 'Month', '4' => 'Year'),
            'gender' => array('1' => 'Male', '2' => 'Female', '3' => 'Both'),
            'minSalary' => array('1' => '1000', '2' => '2000', '3' => '3000', '4' => '4000', '5' => '5000', '6' => '6000', '7' => '7000', '8' => '8000', '9' => '9000', '10' => '10000'),
            'maxSalary' => array('1' => '1000', '2' => '2000', '3' => '3000', '4' => '4000', '5' => '5000', '6' => '6000', '7' => '7000', '8' => '8000', '9' => '9000', '10' => '10000'),
            'minAge' => array('1' => '14', '2' => '15', '3' => '16', '4' => '17', '5' => '18', '6' => '19', '7' => '19', '7' => '20', '8' => '21', '9' => '22', '10' => '23', '11' => '24'),
            'maxAge' => array('1' => '14', '2' => '15', '3' => '16', '4' => '17', '5' => '18', '6' => '19', '7' => '19', '7' => '20', '8' => '21', '9' => '22', '10' => '23', '11' => '24'),
            'posted_type' => array('1' => '03 Days Ago', '2' => '07 Days Ago', '3' => '15 Days Ago', '4' => '30 Days Ago'),
            'proficiency' => array('1' => 'Expert', '2' => 'Moderate', '3' => 'Beginner'),
            'jobIndustry' => array('1' => 'Power', '2' => 'Real Estate', '3' => 'Retailing', '4' => 'Telecom', '5' => 'Advertising', '6' => 'Agriculture/Dairy Based', '7' => 'Airlines','8'=>'Beauty/Fitness/PersonalCare/SPA','9'=>'Beverages/ Liquor','10'=>'Cement','11'=>'Consultancy','12'=>'Courier/Freight/Transportation','13'=>'Dotcom','14'=>'E-Learning','15'=>'Engineering,Procurement,Construction','16'=>'Facility management','17'=>'Fertilizer/Pesticides','18'=>'Food & Packaged Food','19'=>'Textiles / Yarn / Fabrics / Garments','20'=>'Gems & Jewellery','21'=>'Government/ PSU/ Defence','22'=>'Home Appliances (TV, Fridge, AC etc.)','23'=>'Hospitals/ Health Care','24'=>'Hotels/ Restaurant','25'=>'Import / Export','26'=>'Iron/ Steel','27'=>'ISP','28'=>'ISP','29'=>'Leather','30'=>'Market Research','31'=>'Medical Transcription','32'=>'Mining','33'=>'NGO','34'=>'Non-Ferrous Metals (Aluminium, Zinc etc.)','35'=>'Office Equipment','36'=>'Paints','37'=>'Paper','38'=>'Printing/ Packaging','39'=>'Public Relations (PR)','40'=>'Semiconductor','41'=>'Shipping','42'=>'Social Media','43'=>'Sugar','44'=>'Travel/ Tourism','45'=>'Tyres','46'=>'Wood','47'=>'Other','48'=>'Any'),
            'jobFuncArea' => array('1' => 'Admin/Secretarial', '2' => 'Customer Service/ Call Centre/ BPO', '3' => 'Finance & Accounts', '4' => 'Human Resources', '5' => 'IT', '6' => 'Legal', '7' => 'Marketing & Communications','8'=>'Purchase/ Logistics/ Supply Chain','9'=>'Sales/ Business Development','10'=>'Advertising/Entertainment/Media','11'=>'Others')
        );
        $array['testimonial'] = array(
            'show-on-screen' => array('0' => 'No', '1' => 'Yes'),
        );

        $array['vendor_params'] = array(
            'package' => array('1' => 'Package 1', '2' => 'Package 2', '3' => 'Not Applicable'),
            'featured' => array('1' => 'Yes', '0' => 'No'),
            'microsite_status' => array('1' => 'Yes', '0' => 'No'),
            'store_type' => array('1' => 'Head Quarters', '2' => 'Outlet'),
            'jobType' => array('1' => 'Full Time', '2' => 'Part Time', '3' => 'Internship', '4' => 'Work from home', '5' => 'Volunteering', '6' => 'Contract', '7' => 'Casual'), //created by Mandar Kulkarni on 03-07-12
            'empProjType' => array('1' => 'FullTime', '2' => 'PartTime', '6' => 'Contractual'), 
            'projRole' => array('MN' => 'Manager', 'TL' => 'TeamLead', 'S' => 'Supervisor', 'ME' => 'Member'), 
            'projLocation' => array('ONS' => 'Onsite', 'OFS' => 'Offsite'), 
            'status' => array('1' => 'Completed', '2' => 'Pursuing')  
        );
        $array['survey'] = array(
            'htmlOptions' => array('1' => 'Radio Button', '2' => 'Check Box'),
        );
        $array['competition'] = array(
            'htmlOptions' => array('1' => 'Radio Button', '2' => 'Check box', '3' => 'Text box'),);

        $array['banner'] = array(
            'banner_type' => array('1' => 'Home', '2' => 'Microsite', '3' => 'Brands', '4' => 'Jobs', '5' => 'Discounts', '6' => 'Compete', '7' => 'MyJobs', '8' => 'Points', '9' => 'Home-small-left', '10' => 'conceptual'),
        );

        $array['offer'] = array(
            'offer_type' => array('Product' => 'Product', 'Training' => 'Training', 'Event' => 'Event'),
            'status' => array('1' => 'Online', '2' => 'In-Store', '3' => 'Launch Offer', '4' => 'Latest Offer'),
            'categories' => array('1' => 'All', '2' => 'Online', '3' => 'Instore', '4' => 'Deal of Day', '5' => 'Product Launch'),
        );
       
        
         $array['profile_completion'] = array(
            'project' => array('client_name' => '1', 'project_title' => '1', 'project_description' => '1', 'duration_month' => '1', 'role' => '1'),
            'personal_details' => array('first_name' => '2', 'last_name' => '2', 'gender' => '4', 'mobile_number' => '4', 'birth_date' => '4', 'saddress' => '4'),
            'summary_experience' => array('summary' => '5', 'experience_month' => '5', 'skills' => '5', 'industry' => '5'),
            'summary_fresher' => array('summary' => '5', 'experience_month' => '0.65', 'skills' => '0.65', 'industry' => '0.65'),
            'educational_10_fresher' => array('schoolID' => '0.65', 'board' => '5', 'year_to' => '5', 'percentage' => '5'),
            'educational_12_fresher' => array('specilization' => '0.65', 'board' => '0.65', 'year_to' => '0.65', 'percentage' => '0.65', 'status' => '0.65', 'collegeID' => '0.60'),
            'educational_DG_fresher' => array('specilization' => '0.65', 'board' => '0.65', 'year_to' => '0.65', 'percentage' => '0.65', 'status' => '0.65', 'collegeID' => '0.65', 'course_name' => '0.65', 'university' => '0.65'),
            'educational_PG_fresher' => array('specilization' => '0.65', 'board' => '0.60', 'year_to' => '0.65', 'percentage' => '0.65', 'status' => '0.65', 'collegeID' => '0.65', 'course_name' => '0.65', 'university' => '0.65'),
            'educational_DOC_fresher' => array('specilization' => '0.65', 'board' => '0.65', 'year_to' => '0.65', 'percentage' => '0.65', 'status' => '0.60', 'collegeID' => '0.65', 'course_name' => '0.65', 'university' => '0.65'),
            'educational_10_experience' => array('schoolID' => '0.35', 'board' => '0.30', 'year_to' => '0.30', 'percentage' => '0.30'),
            'educational_12_experience' => array('specilization' => '0.35', 'board' => '0.30', 'year_to' => '0.30', 'percentage' => '0.30', 'status' => '0.30', 'collegeID' => '0.30'),
            'educational_DG_experience' => array('specilization' => '0.35', 'board' => '0.30', 'year_to' => '0.30', 'percentage' => '0.30', 'status' => '0.30', 'collegeID' => '0.30', 'course_name' => '0.30', 'university' => '0.30'),
            'educational_PG_experience' => array('specilization' => '0.35', 'board' => '0.30', 'year_to' => '0.30', 'percentage' => '0.30', 'status' => '0.30', 'collegeID' => '0.30', 'course_name' => '0.30', 'university' => '0.30'),
            'educational_DOC_experience' => array('specilization' => '0.30', 'board' => '0.30', 'year_to' => '0.30', 'percentage' => '0.30', 'status' => '0.30', 'collegeID' => '0.30', 'course_name' => '0.30', 'university' => '0.30'),
            'extra_course' => array('institute_name' => '3', 'certificate' => '4', 'description' => '3'),
            'other_detail' => array('goals' => '3', 'hobbies' => '2', 'physical_challenged' => '2', 'description' => '3'),
            'desiredjob' => array('djob_cityID' => '1', 'job_type' => '1', 'industry' => '1', 'profile' => '1', 'salary' => '1'),
            'exp' => array('employer_name' => '3', 'employment_status' => '3', 'employment_type' => '3', 'designation' => '3', 'salary' => '3'),
            'extraactivity' => array('extra_curr_activity' => '3'),
            'achievement' => array('achivements' => '3'),
            'socparticipation' => array('participation' => '2', 'role' => '2',),
        );
		$array['feedback'] = array(
								'reason'=> array('1'=>'Reason 1','2'=>'Reason 2','3'=>'Reason 3'),
								);	
		$array['share_email'] = array(
								'type'=> array('offer'=>'1','job'=>'2','survey'=>'3', 'competition'=>'4'),
								);
		$array['user'] = array(
								'gender'=> array('0'=>'Male','1'=>'Female'),
								'goals'=>array(
								'1'=>'To Work in Aueronatic space',
								'2'=>'To be reasearch Analyst',
								'3'=>'Work with leading marketing team',
								'4'=>'Work for organisation growth and grow with organisation',
								'5'=>'To be Team leader',	
								'6'=>'To be Sales Manager',		
								),
								);

       

        $array['languages'] = array('English' => 'English',
                                     'Marathi' => 'Marathi',
                                     'Hindi' => 'Hindi',
                                     'Spanish' => 'Spanish',
                                     'German' => 'German');
        
      
        $this->params = $array;
    }

    public static function getYearValue($start, $end) {
        $yearPass = array();
        for ($i = $start; $i <= $end; $i++) {
            $yearPass[$i] = $i;
        }
        return $yearPass;
    }
    public static function getYearValueDescend($start, $end) {
        $yearPass = array();
        for ($i = $end; $i >= $start; $i--) {
            $yearPass[$i] = $i;
        }
        return $yearPass;
    }

    public static function getMonthValue($start, $end) {
        $monthPass = array();
        for ($i = $start; $i <= $end; $i++) {
            $monthPass[$i] = $i;
        }
        return $monthPass;
    }

    public static function getSalaryRangeValue($start, $end) {
        $monthPass = array();
        for ($i = $start; $i <= $end; $i += 1000) {
            $monthPass[$i] = $i;
        }
        return $monthPass;
    }

    public static function getRangeValue($start, $end) {
        $monthPass = array();
        for ($i = $start; $i <= $end; $i++) {
            $monthPass[$i] = $i;
        }
        return $monthPass;
    }

    public static function getRangeValueNA($start, $end) {
        $monthPass = array();
        $monthPass[0] = "NA";
        for ($i = $start; $i <= $end; $i++) {
            $monthPass[$i] = $i;
        }
        return $monthPass;
    }

    public static function getDays($start, $end) {
        $monthPass = array();
        for ($i = $start; $i <= $end; $i++) {
            if ($i == 1)
                $sign = " day";
            else
                $sign = " days";
            $monthPass[$i] = $i . $sign;
        }
        return $monthPass;
    }

    public static function getDaysNA($start, $end) {
        $monthPass = array();
        $monthPass[0] = "NA";
        for ($i = $start; $i <= $end; $i++) {
            if ($i == 1)
                $sign = " day";
            else
                $sign = " days";
            $monthPass[$i] = $i . $sign;
        }
        return $monthPass;
    }

    public static function getImageUrl($type, $params) {
        switch ($type) {
            case 'BANNER-IMAGES':
                $folder = "bannerImages";
                break;

            case 'VENDOR-IMAGES':
                $folder = "vendorImages";
                break;

            case 'VENDOR-IMAGES-THUMB':
                $folder = "vendorImagesThumb";
                break;

            case 'VENDOR-BACKGROUND-IMAGES':
                $folder = "vendorBackgroundImage";
                break;

            case 'OFFER-THUMBNAIL':
                $folder = "offerThumbnail";
                break;
           case 'FB-OFFER-THUMBNAIL':
                $folder = "facebook_offer_image";
                break;
            case 'OFFER-ORIGINAL':
                $folder = "offerOriginal";
                break;

            case 'AD-VIDEO':
                $folder = "advertiseVideo";
                break;

            case 'AD-VIDEO-IMAGE':
                $folder = "advertiseVideoImage";
                break;

            case 'PROFILE-IMAGES-THUMBNAIL':
                $folder = "profileImagesThumbnail";
                break;
			case 'PROFILE-IMAGES':
                $folder = "profileImages";
                break;
            case 'COLLEGE-ID-IMAGES':
                $folder = "collegeIdImages";
                break;

            case 'COMPETITION-IMAGES':
                $folder = "competitionImages";
                break;
				
			case 'FB-COMPETITION-IMAGES':
                $folder = "facebook_comptImages";
                break;

            case 'COMPETITION-USER-IMAGES':
                $folder = "competitionUserImages";
                break;

            case 'SURVEY-IMAGES':
                $folder = "surveyImages";
                break;
			
			case 'FB-SURVEY-IMAGES':
                $folder = "facebook_surveyImages";
                break;

            case 'CATEGORY-IMAGES':
                $folder = "categoryImages";
                break;

            case 'JOBTYPE-IMAGE':
                $folder = "jobtypeImage";
                break;

            case 'JOBTYPE-THUMBNAILS':
                $folder = "jobtypeImgthumb";
                break;

            case 'CATEGORY-IMAGE':
                $folder = "categoryImage";
                break;

            case 'CATEGORY-THUMBNAILS':
                $folder = "categoryImgthumb";
                break;

            case 'VIDEO-THUMBNAILS':
                $folder = "BrandVideoThumb";
                break;
            
            case 'STATIC-PAGE':
                $folder = "staticPageIcon";
                break;
        }
        $image_url = ApplicationConfig::app()->params['url_path'][$folder] . $params['file_name'];
        return $image_url;
    }

    public static function getImagePath($type, $params) {
        switch ($type) {
            case 'BANNER-IMAGES':
                $folder = "bannerImages";
                break;

            case 'VENDOR-IMAGES':
                $folder = "vendorImages";
                break;

            case 'VENDOR-IMAGES-THUMB':
                $folder = "vendorImagesThumb";
                break;

            case 'OFFER-THUMBNAIL':
                $folder = "offerThumbnail";
                break;
            case 'PRODUCTCATALOGUE-THUMBNAIL':
                $folder = "productcatalogueThumbnail";
                break;

            case 'OFFER-ORIGINAL':
                $folder = "offerOriginal";
                break;

            case 'AD-VIDEO':
                $folder = "advertiseVideo";
                break;

            case 'AD-VIDEO-IMAGE':
                $folder = "advertiseVideoImage";
                break;

            case 'PROFILE-IMAGES':
                $folder = "profileImages";
                break;

            case 'COLLEGE-ID-IMAGES':
                $folder = "collegeIdImages";
                break;

            case 'COMPETITION-IMAGES':
                $folder = "competitionImages";
                break;

            case 'SURVEY-IMAGES':
                $folder = "surveyImages";
                break;

            case 'JOBTYPE-IMAGE':
                $folder = "jobtypeImage";
                break;

            case 'JOBTYPE-THUMBNAILS':
                $folder = "jobtypeImgthumb";
                break;

            case 'CATEGORY-IMAGE':
                $folder = "categoryImage";
                break;

            case 'CATEGORY-THUMBNAILS':
                $folder = "categoryImgthumb";
                break;

            case 'VIDEO-THUMBNAILS':
                $folder = "BrandVideoThumb";
                break;
            
            case 'STATIC-PAGE':
                $folder = "staticPageIcon";
                break;
        }
        $image_path = ApplicationConfig::app()->params['url_path'][$folder];
        return $image_path;
    }

    public static function getVideoUrl($type, $params) {
        switch ($type) {
            case 'VIDEO-ORIGINAL':
                $folder = "BrandOriginalVideo";
                break;

            case 'VIDEO-CONVERTED':
                $folder = "BrandConvertedVideo";
                break;
        }
        $video_url = ApplicationConfig::app()->params['url_path'][$folder] . $params['file_name'];
        return $video_url;
    }

    public static function getVideoPath($type, $params) {
        switch ($type) {
            case 'VIDEO-ORIGINAL':
                $folder = "BrandOriginalVideo";
                break;

            case 'VIDEO-CONVERTED':
                $folder = "BrandConvertedVideo";
                break;
        }
        $video_path = ApplicationConfig::app()->params['url_path'][$folder];
        return $video_path;
    }

    public static function getURL($module, $controller, $action, $arrParameter = array(), $config = array()) {
        $module_name = "";
		$flag = "";
		$flg = "";
        if ($module !== "" && isset(ApplicationConfig::app()->params['module'][$module])) {
            $module_name = ApplicationConfig::app()->params['module'][$module] . "/";
        }

        $url = $module_name . $controller . "/" . $action . "/";

        if ($controller == "" && $module == "") {
            $url = $action . "/";
        }
        foreach($arrParameter as $key=>$val)
        {
            if(empty($key))
            {
                $flag =1;
                $value = $val;
            }
            if($key=='spcbrands')
            {
                $flg = 2;
                $value2 = $val;
            }
        }
        if($flag == 1&&empty($flg))
        {
            $url = $action . "/".$value;
            return Yii::app()->createUrl($url);
        }
        else if($flg==2)
        {
            $url = $action . "/".$value2."/".$value;
             return Yii::app()->createUrl($url);
        } 
        else
        { 
        return Yii::app()->createUrl($url, $arrParameter);
        }
        
    }

    
    public static function getConstantData($type) {
        $arrReturn = array();
        switch ($type) {
            case 'USER-TYPE':
                $arrReturn = array('client' => 'Client', 'company' => 'Company');
                break;

            case 'CURRENCY':
                $arrReturn = array('US' => 'US', 'EURO' => 'EURO');
                break;
        }
        return $arrReturn;
    }

    public static function truncateString($text, $nbrChar, $append = '...') {
        if (strlen($text) > $nbrChar) {
            $text = substr($text, 0, $nbrChar);
            $text .= $append;
        }
        return $text;
    }

    public static function getImagedimensions($type) {
        switch ($type) {
            case 'normal':
                return array('scale' => 99);
                break;

            case 'medium':
                return array('width' => 220, 'height' => 140);
                break;

            case 'thumbnail':
                return array('width' => 120, 'height' => 80);
                break;
        }
    }

    public static function getServerName() {
        return isset(Yii::app()->request->serverName) ? Yii::app()->request->serverName : null;
    }

    public static function getStaticValue($id) {

        return $id;
    } 

    public static function getUserResume($userID) {
        return "";
    }
    
    public static function sendmail($recievermail, $recievername,$subject,$htmlmsg){
    	/*Yii::import('application.extensions.phpmailer.JPhpMailer');
    	$mail = new JPhpMailer;
		$mail->IsSMTP();
		$mail->Mailer = "smtp";
		$mail->SMTPSecure = "ssl";  
		$mail->Host='smtp.gmail.com';  
		$mail->Port='465';   
		$mail->SMTPAuth = true;
		$mail->Username = ""; // GMAIL username
		$mail->Password = ""; // GMAIL password
		 $mail->SetFrom("",'');
		/*$mail->Subject = "User Registration msg" ;
		$mail->MsgHTML('<h1>JUST A TEST!</h1>');
		$mail->AddAddress("vivek.tiwari@fortune4technologies.com","vivek"); 
		
		$mail->Subject =$subject;
		$mail->MsgHTML($htmlmsg);
		$mail->AddAddress($recievermail,$recievername);
   		$mail->Send();*/
			
    }

    public static function mulltiSelect($selected, $list,$arrParams=array()) {
        $cnt = 0;
        echo CHtml::tag('option',array('value'=>''),CHtml::encode($arrParams['empty']),true);
        foreach ($list as $id => $value) {
            if (count($selected) > $cnt && $selected[$cnt] == $id) {
//                    echo $cityID[$cnt]."...".$id;exit;
                echo CHtml::tag('option', array('value' => $id, 'selected' => 'selected'), CHtml::encode($value), true);
                $cnt++;
            } else {
                echo CHtml::tag('option', array('value' => $id), CHtml::encode($value), true);
            }
        }
    }

		public static function deleteDir($dirPath) {
		    if (! is_dir($dirPath)) {
		        throw new InvalidArgumentException('$dirPath must be a directory');
		    }
		    if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
		        $dirPath .= '/';
		    }
		    $files = glob($dirPath . '*', GLOB_MARK);
		    foreach ($files as $file) {
		        if (is_dir($file)) {
		            self::deleteDir($file);
		        } else {
		            unlink($file);
		        }
		    }
		    if ($dirPath != YiiBase::getPathOfAlias('webroot.assets') . '/')
		    rmdir($dirPath);
		}
		public static function deleteFile($dirPath,$filename) {
		    if (! is_dir($dirPath)) {
		        throw new InvalidArgumentException('$dirPath must be a directory');
		    }
		    if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
		        $dirPath .= '/';
		    }
		    $files = glob($dirPath . '*', GLOB_MARK);
		    foreach ($files as $file) {
		        if (is_dir($file)) {
		            self::deleteFile($file,$filename);
		        } else {
		        	//echo $file." ------------------";
		        	//echo $dirPath.$filename."<br/>";
		        	if ($file == $dirPath.$filename){
		            	if(unlink($file))
		            	echo "deleted successfully";
		            	else 
		            	echo "Error occured. Please check file name and try again.";
		        	}
		        }
		    }
		    
		}
	public static function ArryMovetoTop($array, $key) {
	    $temp = array($key => $array[$key]);
	    unset($array[$key]);
	    $array = $temp + $array;
	    return $array;
	}
	public static function getSystemUrl()
	{
	    $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
	    $sp = strtolower($_SERVER["SERVER_PROTOCOL"]);
	    $protocol = substr($sp, 0, strpos($sp, "/")) . $s;
	    $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
	    $host = (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST']))? $_SERVER['HTTP_HOST']:$_SERVER['SERVER_NAME'];
	    return $protocol . "://" . $host . $port . $_SERVER['REQUEST_URI'];
	}
	public static function findAge($bMonth,$bDay,$bYear) {
	    list($cYear, $cMonth, $cDay) = explode("-", date("Y-m-d"));
	    return ( ($cMonth >= $bMonth && $cDay >= $bDay) || ($cMonth > $bMonth) ) ? $cYear - $bYear : $cYear - $bYear - 1;
	}
	public static function getPathSegments($url) {
	     $parts = explode('/', $url);
	     //var_dump($parts);exit;
	     $last = "";
	     foreach ($parts as $key => $value)
	     {
	     	if ($key != 0 && $key != 1 && $key != 2)
	     	{
	     		
	     		if ($value == "compete")
	     		$value = "Competitions";
	     		if (!empty($value))
	     		$last .= " | ".ucfirst($value);
	     	}
	     	
	     }
	     	if ($last == "")
	     	$last = " | Home";
 		 
	    return $last; // get the last segment
	}
	public static function GenerateJSON($type,$arrParams = null)
        {
        	switch ($type)
        	{
        		case 'LATEST-HOME-OFFERS':
        			
	        			$models = Offer::getList("LATEST-OFFERS", array()) ;
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
        		
        		case 'LATEST-HOME-JOBS':
	        			$models = Job::getList("LATEST-JOBS", array());
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
        			
        		case 'RHS-HOME':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
        			
        		case 'CATEGORY-HOMEPAGE-IMAGES':
	        			$models = BannerDetails::getList("CATEGORY-HOMEPAGE-IMAGES", array());
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
        		case 'HOME-SLIDER-IMAGES':
	        			$models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;

					
						
        		case 'RHS-BRANDS':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
				case 'RHS-DISCOUNTS':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
				case 'RHS-JOBS':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'RHS-COMPETE':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'RHS-COMPETE-DISPLAY':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'RHS-SURVEY-DISPLAY':
	        			$models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
    
	                case 'RHS-COMP-DETAIL':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
                   
				   case 'RHS-YOUTH-SUPPORT':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'RHS-PROFILE-DETAIL':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						
        			break;
					case 'RHS-MYPOINTS':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						
        			break;
					case 'RHS-MYCART':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						
        			break;
					case 'RHS-MYJOBS':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
                   
				   case 'RHS-SHARE-EARN':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
					 case 'RHS-POINT':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
					case 'RHS-WINNER':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
					case 'RHS-VIDEOS':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
						case 'RHS-SEARCH':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
						case 'RHS-REGISTRATION':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
					case 'RHS-JOB-DESCRIPTION':
					    $models = BannerDetails::getList("RHS", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
					break;
					
        		  case 'BRAND-SLIDER-IMAGES':
	        			$models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'DISCOUNTS-SLIDER-IMAGES':
	        			$models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'JOBS-SLIDER-IMAGES':
	        			$models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'COMPETE-SLIDER-IMAGES':
	        			$models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'COMPETE-DISPLAY-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'SURVEY-DISPLAY-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'SHARE-EARN-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'MYPOINT-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'POINT-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'WINNER-SLIDER-IMAGES':
					    $models = BannerDetails::getList("SLIDER-IMAGES", array('pageID'=>$arrParams['pageID'],'locationID'=>$arrParams['locationID'],'vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'BRAND-CLOUD':
	        			$models = Vendor::getList("BRAND-CLOUD");
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
        			break;
					
					case 'LATEST-POINT-OFFERS':
        			   $models = Offer::getList("LATEST-OFFERS", array('featured'=>'0')) ;
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'TOP-BRANDS':
        			    $models = Vendor::getList("TOP-BRANDS",array());
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'MYCART-FEATURED-OFFERS':
						
        			    $models = Vendor::model()->getList("VENDOR-ID",array('vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						
						// case 'TOP-RECRUITERS':
						
        			    // $models = Vendor::model()->getList("VENDOR-ID",array('vendorID'=>$arrParams['vendorID']));
						// $data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						// break;
						
						case 'SURVEY-LIST':
						$models = SurveyMain::model()->getList('BY-ID', array('id'=>$arrParams['id']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'SURVEY-LIST-VENDOR':
						$models =Vendor::model()->getList("VENDOR-ID",array('vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'COMP-LIST':
						$models = CompetitionMain::model()->getList('BY-ID', array('id'=>$arrParams['id']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'COMP-LIST-VENDOR':
						$models =Vendor::model()->getList('VENDOR-ID',array('vendorID'=>$arrParams['vendorID']));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
        			    
						case 'ALL-BRANDS':
						$models = Vendor::model()->with('vendorStores')->findAll('status=1',array());
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'ALL-DISCOUNTS':
						$models = Offer::model()->with('vendor')->findAll('MAKE_LIVE=1');
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
						
						case 'ALL-JOBS':
						$models =Job::getList("JOB-TYPE", array('job_type'=>'all','data'=>$_POST));
						$data=array_map(create_function('$m','return $m->getAttributes();'),$models);
						break;
					 

        			
        	}
        	
        	file_put_contents(ApplicationConfig::app()->params['folder_path']['JSONFiles'].strtolower($type).".json", json_encode($data));
        }
	public static function GetJSON($type,$arrParams = null)
        {
						///var_dump(file_get_contents(ApplicationConfig::app()->params['folder_path']['JSONFiles'].$type.".json"));exit;
        				if (file_exists(ApplicationConfig::app()->params['folder_path']['JSONFiles'].strtolower($type).".json"))
        				{
        					$data = json_decode(file_get_contents(ApplicationConfig::app()->params['folder_path']['JSONFiles'].strtolower($type).".json"));
        					
        					return $data;
        				}
        				else 
        				{
        					ApplicationConfig::GenerateJSON($type,$arrParams);
        					ApplicationConfig::GetJSON($type,$arrParams);
        				}
        			
        }	

}